Wire up the display as follows:
Display | Pico |
---|---|
VCC | 3V3 |
GND | GND |
SCL | GP5 or another SCL pin |
SDA | GP4 or another SDA pin |
You need to add the Numeric LED library. Copy the adafruit_ht16k33 folder from the lib directory on github to the lib directory on the pico:
Write this code and download to the Pico.
See code on github# Test 7 segment led display
import board
import busio as io
import time
import adafruit_ht16k33.segments
# Create display object
i2c = io.I2C(board.GP5, board.GP4) # SCL, SDA
display = adafruit_ht16k33.segments.Seg7x4(i2c, address=0x70)
## Clear
display.fill(0)
# Display individual characters
display[0] = '8'
display[1] = '7'
display[2] = 'a'
display[3] = 'm' # some chars can't display
display.show()
time.sleep(2)
# Display number
display.print(1234)
display.show()
time.sleep(2)
# Display letters
display.print('DEAL')
display.show()
time.sleep(2)